﻿@using QuestionsAnswers.UI.Models
@model Course
@{
    ViewBag.Title = "Manage Members";
}
<h2>
    Manage Course</h2>
@Model.Name
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<h3>
    Creator</h3>
@Model.Creator.UserName
<p>
    @if (@Model.CanModify(User.Identity.Name))
    {  
        @Ajax.ActionLink("Invite New", "InviteMember", "Invitation", new CourseMemberIds { CourseId = Model.CourseId, MemberType = "Participant" }, new AjaxOptions { OnSuccess = "OnSuccessGeneral" })
    }
</p>
<h3>
    Owners</h3>
@Html.Partial("UserPartial", new CoursePass { Users = @Model.Owners, Course = @Model, Editable = @Model.CanModify(User.Identity.Name), MemberType = "Owner" })
<h3>
    Participants</h3>
@Html.Partial("UserPartial", new CoursePass { Users = @Model.Participants, Course = @Model, Editable = Model.CanModify(User.Identity.Name), MemberType = "Participants" })
<p>
    @Html.ActionLink("Back to List", "Index")
</p>
